﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Mechanical;
using Autodesk.Revit.UI.Selection;

namespace YArchitech.Revit
{
	public class SpecificDuctFilter : ISelectionFilter
	{
		public List<ElementId> ElementIdList { get; set; }

		public bool AllowElement(Element elem)
		{
			if (!(elem is Duct))
			{
				return false;
			}
			if (this.ElementIdList == null || this.ElementIdList.Count < 1)
			{
				return false;
			}
			using (List<ElementId>.Enumerator enumerator = this.ElementIdList.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					if (enumerator.Current.IntegerValue == elem.Id.IntegerValue)
					{
						return true;
					}
				}
			}
			return false;
		}

		public bool AllowReference(Reference reference, XYZ position)
		{
			throw new NotImplementedException();
		}
	}
}
